<?php 
$nav= '<a onclick="ajaxSubmit(\'mainContent\',\'projects\')" href="javascript:;">Project</a>'.
 ' :: '.$proj['Project']['name'];
if(Configure::read('Session.isSa') || Configure::read('Session.isAdmin') || Configure::read('Session.isManager')){
	$nav.='<span title="'._resource('source control',true).'"><a href="javascript:;" onclick="deactivateEditors();ajaxSubmit(\'mainContent\',\'source_controls/index/'.$proj['Project']['id'].'\');"> <img border="0" src="'.$this->webroot.'img/backend/icon-16-help-security.png"/></a></span>';
	$nav.='<span title="'._resource('hosts',true).'"><a href="javascript:;" onclick="deactivateEditors();ajaxSubmit(\'mainContent\',\'hosts/index/'.$proj['Project']['id'].'\');"> <img border="0" src="'.$this->webroot.'img/backend/icon-16-module.png"/></a></span>';
	$nav.='<span title="'._resource('edit',true).'"><a href="javascript:;" onclick="deactivateEditors();ajax(\'addContent\',\'projects/edit/'.$proj['Project']['id'].'\');"> <img border="0" src="'.$this->webroot.'img/backend/icon-16-edit.png"/></a></span>';
}
?>
<center>
<div style="clear:both;height:10px;">&nbsp;</div>
<fieldset style="width:80%">
    <legend><?php echo $nav;?></legend>
    <div>
    <?php if(Configure::read('Session.isSa') || Configure::read('Session.isAdmin') || Configure::read('Session.isManager') || Configure::read('Session.isQA')){ ?>
    <div class="button"><a onclick="deactivateEditors();ajax('addContent','<?php echo $this->params['controller'] ?>/add');" href="javascript:;" title="<?php _resource('add');?>"  > <span class="icon-32-new"> </span></a></div>    
  	<div class="button"><a onclick="ajaxSubmit('listContent','<?php echo $this->params['controller'] ?>/delete','delete','listForm',true);" href="javascript:;" title="<?php _resource('delete');?>"  > <span class="icon-32-trash"> </span></a></div>
    
    <?php } ?>
    <div style="float:right">
      <form action="#" method="post" name="filterForm" id="filterForm">
        <table >
       
          <tr>
            <td align="right">             
              <input name="filter_text" size="10" value="<?php echo $this->Session->read($uses[0].'.filterText') ?>" />
              &nbsp;&nbsp;&nbsp;&nbsp;<?php _resource('filter by') ?>:&nbsp;&nbsp;&nbsp;&nbsp;
              <select name="filter_field" id="filter_state" class="inputbox" size="1" >
                <?php 
					foreach($filterField as $k=>$v){
						$select="";
						
						if($k==$this->Session->read($uses[0].'.filterField')){							
							$select='selected="selected"';
						}
						echo '<option value="'.$k.'" '.$select.'>'.$v.'</option>';
					}?>
              </select>
              &nbsp;&nbsp;&nbsp;&nbsp;
              <input type="button" value="<?php _resource('search') ?>" onclick="ajax('listContent','<?php echo $this->params['controller'].'/filter/'.$proj['Project']['id'];?>','filterForm');">
            </td>
          </tr>
          
          <tr>
            <td align="right">Status: &nbsp;    
            <?php echo $this->Form->input($uses[0].'.status_id', array('type'=>'select','options'=>$statuses,'default'=>intval($this->Session->read($uses[0].'.status_id')),'empty'=>false,"class"=>"inputbox","label"=>"","div"=>"","error"=>"",'onchange'=>'ajax("listContent","'.$this->params['controller'].'/status/" + this.value+"/'.$proj['Project']['id'].'","filterForm")'));?>         
				              
            </td>
          </tr>
          
        </table>
      </form>
    </div>
    <div class="clear"></div>         
    </div> 
       
    <div id="listContent">
    	<script>
    		ajax('listContent','<?php echo $this->params['controller'].'/lists/'.$proj['Project']['id'] ?>');
    	</script>
    </div>    
</fieldset>
<a id="addContentZone" href="javascript:;"></a>

<div id="addContent" style="width:900px;"></div>
</center>
